



import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_getx_cms/utils/size_extension.dart';
import 'package:get/get.dart';
import 'package:tdesign_flutter/tdesign_flutter.dart';

import '../../res/assets_path.dart';

class TaskCard extends StatelessWidget {


  const TaskCard({
    Key? key,
  }) : super(key: key);

  @override
   build(BuildContext context) {

    final themeData = TDTheme.of(context);

    return Container(
      padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16),
      color: Colors.white,
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.stretch,
        children: [
          _buildHeader(),
          _buildDivider(),
          _buildContent(),
          8.heightSizedBox,
        ],
      ),
    );

  }


  _buildHeader() {
    final themeData = TDTheme.of(Get.context);
    return Row(
      crossAxisAlignment: CrossAxisAlignment.center,
      children: [
        const TDImage(assetUrl: R.IMAGES_ICON_TXT_PNG, width: 22, height: 22),
        10.widthSizedBox,
        Expanded(
          child: TDText(
            "加纳海外制单进口审批",
            maxLines: 2,
            overflow: TextOverflow.ellipsis,
            font: themeData.fontTitleMedium,
            textColor: Colors.black,
          ),
        ),
      ],
    );
  }

  Widget _buildDivider() {
    return SizedBox(
      height: 16,
      child: Container(
        alignment: Alignment.center,
        child: const TDDivider(),
      ),
    );
  }

  Widget _buildContent() {
    final themeData = TDTheme.of(Get.context);
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        TDText(
          '业务编号：TEST271806',
          maxLines: 1,
          overflow: TextOverflow.ellipsis,
          font: themeData.fontMarkMedium,
          style: TextStyle(color: themeData.grayColor9),
          textAlign: TextAlign.left,
        ),
        8.heightSizedBox,
        Column(
          children: [
            TDText(
              '流水号：Bf_0Ol-20250222-00059',
              maxLines: 1,
              overflow: TextOverflow.ellipsis,
              font: themeData.fontMarkMedium,
              style: TextStyle(color: themeData.grayColor9),
              textAlign: TextAlign.left,
            ),
            8.heightSizedBox
          ],
        ),
        TDText(
          '申请人：系统运维',
          maxLines: 1,
          overflow: TextOverflow.ellipsis,
          font: themeData.fontMarkMedium,
          style: TextStyle(color: themeData.grayColor9),
          textAlign: TextAlign.left,
        ),
        8.heightSizedBox,
        TDText(
          '当前节点：发起人',
          maxLines: 2,
          overflow: TextOverflow.ellipsis,
          font: themeData.fontBodyMedium,
          style: TextStyle(color: themeData.grayColor6),
        ),
      ],
    );
  }


  }